APPENDIX S -- RBBS-PC And BASIC Compiler Patches for "Doors" ------------------------------------------------------------ Both the IBM Version 2.0 BASIC compiler and Microsoft's QuickBASIC compiler offers a lot of needed features to compiled BASIC programs. Regrettably, they also included a few "problems." For those who use RBBS-PC to "exit" to DOS (either via a "door" or as a remote SYSOP), the code generated by the new BASIC compilers would "help" you by dropping carrier when you chose to return to RBBS-PC from DOS or a "door." Help like this RBBS-PC didn't need. Jeff Porter was the first to document a six step "patch" to the IBM BASIC Version 2.0 compiler and to BCOM10.LIB of the QuickBASIC Version 1.0 compiler that corrects this problem within the logic of the code generated by the QuickBASIC compiler. Subsequently, Rod Bowman of "The PC Spectrum", (714) 945-2612,, subsequently, provided similar patches to the BCOM20.LIB of the QuickBASIC Version 2.0 and 2.01 compiler. "RBBS-PC continues to grow and expand because hundreds (and quite possibly thousands) of SYSOP's spend the time and trouble not only to modify RBBS-PC to meet their needs, but also to share these modifications with others." D.Thomas Mack Please note that nowhere in the following documentation does Jeff describe the hours and hours it must have taken him to find the fix to the problem. Nowhere does he ask anything for himself for his efforts. As I have said so often "I am very proud of the company that RBBS-PC keeps." 1. Jeff Porter's DTR Patches for the QuickBASIC Version 1.x Compilers ---------------------------------------------------------------------- As anyone who has tried to write any programs that use COM1: or COM2: with MicroSoft QuickBasic knows, the DTR modem control line is dropped every time a a communication file is opened or closed. I don't know why MicroSoft drops the DTR line all the time; all I know is that it can be a serious problem with programs such as RBBS-PC. Therefore, I present the following patch to fix the problem. This patch modifies the serial communication routines in the BCOM10.LIB file so that the DTR line will be not be turned off. Here is a transcript of a patch session. C>copy bcom10.lib bcom10bk.lib 1 File(s) copied C>debug bcom10.lib -d540 L 10 xxxx:0540 0B D2 75 04 B5 FF EB 34-FA 83 C2 04 32 C0 EE EB ..u....4....2... -d830 L 10 xxxx:0830 14 8B FA E8 00 00 83 C2-04 32 C0 EB 00 EE C7 47 .........2.....G -a54c xxxx:054C mov al, 1 xxxx:054E -a839 xxxx:0839 mov al, 1 xxxx:083B -w Writing 25C00 bytes -q 1. Make a backup copy of the BCOM10.LIB file, just in case. 2. Run debug and load BCOM10.LIB C>debug bcom10.lib 3. Display the following sections of data and see that they match. This is to insure that you are patching the correct version of the library. -d540 L 10 xxxx:0540 0B D2 75 04 B5 FF EB 34-FA 83 C2 04 32 C0 EE EB ..u....4....2... -d830 L 10 xxxx:0830 14 8B FA E8 00 00 83 C2-04 32 C0 EB 00 EE C7 47 .........2.....G 4. If debug shows the same information as listed above, then you may continue with the patching process. If not, go to the section 2 of this appendix. 5. Do the following: -a 54c xxxx:054C mov al, 1 xxxx:054E -a 839 xxxx:0839 mov al, 1 xxxx:083B 6. Now write the file back to disk and quit debug. The patch is complete. -w Writing bytes -q 2. Jeff Porter's DTR Patches for the IBM BASIC Version 2.0 Compiler -------------------------------------------------------------------- If you do not have MicroSoft QuickBasic or if you have a different version than I, you can probably still perform this patch. You will have to find the correct locations to patch. The addresses 054C and 0839 were found with the following procedure: 1. Search for the byte sequence 83 C2 04 32 C0 in the library file. If you are lucky, debug will find it in exactly two places. (for example:) -s 100 fff0 83 C2 04 32 C0 2. Unassemble the addresses you found. The first two instructions will be ADD DX, +04 XOR AL, AL Within the next few instructions should be OUT DX, AL 3. If everything has gone correctly so far, just change the XOR AL, AL to a MOV AL, 1 4. Perform this change in both places where the XOR AL, AL instruction was found. 5. Write the updated file. 3. Rod Bowman's DTR Patch for the QuickBASIC Version 2.0 Compiler ------------------------------------------------------------------ Rod Bowman, of "The 'PC' Spectrum" (tm) whose RBBS-PC data line number is (714) 945-2612 provided the following patch for the QuickBASIC version 2.0 compiler library. This patch modifies the serial communication routines in the BCOM20.LIB file for QuickBASIC version 2.0 so that the DTR line will be not be turned off when running another program with the RUN Command of BASIC! Here is a transcript of a patch session. A>copy bcom20.lib bcom20bk.lib 1 File(s) copied A>debug bcom20.lib -dD368 L 5 xxxx:D368 83 C2 04 32 C0 ..2... -aD36B xxxx:D36B mov al, 1 xxxx:D36D -w Writing 2B000 bytes -q 1. Make a backup copy of the BCOM20.LIB file, just in case. 2. Run debug and load BCOM20.LIB A>debug bcom20.lib 3. Display the following sections of data and see that they match. This is to insure that you are patching the correct version of the library. -dD368 L 5 xxxx:D368 83 C2 04 32 C0 EE EB ..2... 4. If debug shows the same information as listed above, then you may continue with the patching process. If not, go to the section 2 of this appendix. 5. Do the following: -a D36B xxxx:D36B mov al, 1 xxxx:D36D 6. Now write the file back to disk and quit debug. The patch is complete. -w Writing bytes -q 4. Rod Bowman's DTR Patch for the QuickBASIC Version 2.01 Compiler ------------------------------------------------------------------- Rod Bowman, of "The 'PC' Spectrum" (tm) whose RBBS-PC data line number is (714) 945-2612 provided the following patch for the QuickBASIC version 2.01 compiler library. This patch modifies the serial communication routines in the BCOM20.LIB of QuickBASIC version 2.01 file so that the DTR line will be not be turned off when running another program with the RUN Command of BASIC! Here is a transcript of a patch session. A>copy bcom20.lib bcom20bk.lib 1 File(s) copied A>debug bcom20.lib -dD858 L 5 xxxx:D858 83 C2 04 32 C0 -aD85B xxxx:D85B mov al, 1 xxxx:D85D -w Writing xxxxx bytes -q 1. Make a backup copy of the BCOM20.LIB file, just in case. 2. Run debug and load BCOM20.LIB A>debug bcom20.lib 3. Display the following sections of data and see that they match. This is to insure that you are patching the correct version of the library. -dD858 L 5 xxxx:D858 83 C2 04 32 C0 4. If debug shows the same information as listed above, then you may continue with the patching process. If not, go to the section 2 of this appendix. 5. Do the following: -a D85B xxxx:D85B mov al, 1 xxxx:D85D 6. Now write the file back to disk and quit debug. The patch is complete. -w Writing xxxxx bytes -q 5. DTR Patch for the QuickBASIC Version 3.0 Compiler ----------------------------------------------------- This patch modifies the serial communication routines in the BCOM30.LIB of QuickBASIC version 3.0 file so that the DTR line will be not be turned off when running another program with the RUN Command of BASIC! Here is a transcript of a patch session. A>copy bcom30.lib bcom30bk.lib 1 File(s) copied A>debug bcom30.lib -dDC08 L 5 xxxx:DC08 83 C2 04 32 C0 -aDC0B xxxx:DC0B mov al, 1 xxxx:DC0D -w Writing xxxxx bytes -q 1. Make a backup copy of the BCOM30.LIB file, just in case. 2. Run debug and load BCOM30.LIB A>debug bcom30.lib 3. Display the following sections of data and see that they match. This is to insure that you are patching the correct version of the library. -dDC08 L 5 xxxx:DC08 83 C2 04 32 C0 4. If debug shows the same information as listed above, then you may continue with the patching process. If not, go to the section 2 of this appendix. 5. Do the following: -a DC0B xxxx:DC0B mov al, 1 xxxx:DC0D 6. Now write the file back to disk and quit debug. The patch is complete. -w Writing xxxxx bytes -q